<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <link rel="stylesheet" href="/Demo/css/bootstrap.min.css">
  <style>
    form {
      margin: 50px auto;
      width: 400px;
    }
  </style>
</head>

<body>
  <script>
   
    function jump() {
      var user = document.getElementById('firstname').value;
      var password = document.getElementById('lastname').value;
      console.log(user)
      console.log(password)
      if (user == "admin" && password == "m123") {
        alert("登录成功")
        location.href = "当当网.html"
      } else {
        alert("密码错误!")
        location.href = "login.html"
      }

    }
  </script>
  <div class="row" style="margin-top: 50px;">
    <div class="col-md-4"></div>
    <div class="col-md-4 " style="text-align: center;">
      <h2>当当登录</h2>
    </div>
    <div class="col-md-4"></div>
  </div>

  <!-- for -->
  <form class="form-horizontal" role="form" onsubmit="return false">
    <div class="form-group">
      <label for="firstname" class="col-sm-2 control-label">账号</label>
      <div class="col-sm-10">
        <input type="text" class="form-control" id="firstname" placeholder="请输入账号">
      </div>
    </div>
    <div class="form-group">
      <label for="lastname" class="col-sm-2 control-label">密码</label>
      <div class="col-sm-10">
        <input type="text" class="form-control" id="lastname" placeholder="请输入密码">
      </div>
    </div>
    <div class="form-group">
      <div class="col-sm-offset-2 col-sm-10">
        <div class="checkbox">
          <label>
            <input type="checkbox">请记住我
          </label>
        </div>
      </div>
    </div>
    <div class="form-group">
      <div class="col-sm-offset-2 col-sm-10">
        <button type="submit" class="btn btn-success" onclick="jump()">登录</button>
        <button type="reset" class="btn btn-primary">注销</button>
      </div>
    </div>
  </form>
  </tbody>
  </table>

</body>

</html>